<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Vue 2.7 + Element UI</title>
    <!-- 引入 Vue 2.7 -->
    <script src="https://unpkg.com/vue@2.7.14/dist/vue.min.js"></script>

    <!-- 引入 Element UI 样式 -->
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css" />

    <!-- 引入 Element UI -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
  </head>
  <body>
    <div id="app">
      <el-container>
        <el-header>
          <h1>{{ title }}</h1>
        </el-header>
        <el-main>
          <el-input v-model="input" placeholder="请输入内容"></el-input>
          <el-button type="primary" @click="showMessage">点击我</el-button>
        </el-main>
        <el-footer>
          <p>底部内容</p>
        </el-footer>
      </el-container>
    </div>

    <script>
      // 初始化 Vue 应用
      new Vue({
        el: '#app',
        data: {
          title: 'Vue 2.7 + Element UI 示例',
          input: ''
        },
        methods: {
          showMessage() {
            this.$message({
              message: `您输入的是：${this.input}`,
              type: 'success'
            })
          }
        }
      })
    </script>
  </body>
</html>
